cmake_minimum_required(VERSION 3.5)

project(LogView LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories("Controls")

find_package(Qt5 COMPONENTS Widgets REQUIRED)

if(ANDROID)
  add_library(LogView SHARED
    main.cpp
    mainwindow.cpp
    mainwindow.h
    mainwindow.ui
  )
else()
  add_executable(LogView
    main.cpp
    mainwindow.cpp
    mainwindow.h
    mainwindow.ui
    Controls/codeeditor.cpp
    Controls/codeeditor.h
  )
endif()

target_link_libraries(LogView PRIVATE Qt5::Widgets)

target_link_libraries(LogView PRIVATE zip)
